using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;

namespace Itdavany.Data
{
    public struct ShadowInfo
    {
        public static ShadowInfo None
        {
            get
            {
                return new ShadowInfo(Position.Origin, 0.0f);
            }
        }

        public Position offset;
        public float scale;

        public static bool operator ==(ShadowInfo left, ShadowInfo right)
        {
            if (left.scale == 0.0f && right.scale == 0.0f)
                return true;
            else
                return (left.scale == right.scale) && (left.offset == right.offset);
        }

        public static bool operator !=(ShadowInfo left, ShadowInfo right)
        {
            return !(left == right);
        }

        public override bool Equals(object obj)
        {
            if (obj == null)
                return false;
            else if (obj.GetType().Equals(typeof(ShadowInfo)))
                return false;
            return this == (ShadowInfo)obj;
        }

        public override int GetHashCode()
        {
            if (scale == 0.0f)
                return 0;
            return scale.GetHashCode() + offset.GetHashCode() * 29;
        }

        public ShadowInfo(Position offset, float scale)
        {
            this.offset = offset;
            this.scale = scale;
        }
    }
}
